package com.cat.model.biz.service.admin.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.alonew.db.dao.TxCommonDAO;
import com.cat.model.biz.service.admin.CompanyInfoService;
import com.cat.model.common.model.common.CompanyInfoVO;

@Service("companyInfoService")
public class CompanyInfoServiceImpl implements CompanyInfoService{
	@Autowired
	private TxCommonDAO commonDAO;
	
	@Override
	public CompanyInfoVO createCompanyInfo(CompanyInfoVO companyInfo){
		commonDAO.insert(companyInfo);
		
		return companyInfo;
	}
	
	@Override
	public int deleteCompanyInfo(long id){
		CompanyInfoVO companyInfo = new CompanyInfoVO();
		companyInfo.setId(id);
		return commonDAO.deleteById(companyInfo);
	}
	
	@Override
	public int updateCompanyInfo(CompanyInfoVO companyInfo){
		return commonDAO.updateById(companyInfo, "name", "companyCode");
	}
}
